var goodsDetail = {
  id: '',
  init: function (id) {
    this.id = id
    if (!this.id) { return }
    // this.getPoint()
    this.renderBg()
    this.getData()
    this.render()
  },
  getPoint: function () {
    var data = getPoints()
    // if (!data.data) return
    page.data.point = data.data
  },
  renderBg: function () {
    try {
      var picture = page.data.bgs[9].subColumn[0].typePicture[0].picPath3
      $("#main").css("background-image", "url(" + picture + ")");
    } catch (err) {
      console.log(err)
    }
  },
  getData: function () {
    var data = getVodDetailInfo(this.id)
    page.data.goodsDetail = data
  },
  render: function () {
    var data = page.data.goodsDetail
    var arr = ['picPath92', 'picPath93', 'picPath94', 'picPath95', 'picPath96'];
    var swiperList = [];
    for (var i = 0, l = arr.length; i < l; i++) {
      if (data.picture[0][arr[i]]) {
        swiperList.push({
          picPath: data.picture[0][arr[i]]
        });
      }
    }
    var html = '<div class="title">' + data.name + '</div>';
    html += '<div class="price"><span>' + data.price + '</span> 熊猫币 </div>';
    html += '<div class="info">' + (data.introduce || '') + '</div>';
    $('#detail').html(html);
    this.renderSlide(swiperList)
  },
  renderSlide: function (swiperList) {
    // var this = this;
    var html = '<ul>';
    for (var i = 0, l = swiperList.length; i < l; i++) {
      html += '<li class="slide-item"><img src="' + swiperList[i].picPath + '"/></li>'
    }
    html += '</ul>';
    $('#main-0').html(html)
    $('#btn').show()
    var unslider = $('#main-0').unslider({
      dots: true,
      delay: 5000,
      keys: false
    });
    this.unslider = unslider.data('unslider');  
  }
}